package org.jeecg.common.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * T+枚举与系统枚举处理
 *
 * @author hzq
 */

@Getter
@AllArgsConstructor
public enum TPlusToEz2bizEnum {
    SSLB("所属类别", "SSLB", "所属类别", ""),
    EJFL("二级分类", "EJFL", "二级分类", ""),
    HDHHY("含电", "HDHHY", "含电", ""),
    SPPP("适用品牌", "SPPP", "适用品牌", "C05"),
    PP("品牌", "PP", "品牌", ""),
    ZL("质量", "ZL", "质量", ""),
    XH("适用型号", "XH", "适用型号", ""),
    XZ("普F", "XZ", "普F", ""),
    XFPP("材质与细分品牌", "XFPP", "材质与细分品牌", "C03"),
    GYQK("供应情况", "GYQK", "供应情况", ""),
    JLFS("计量方式", "JLFS", "计量方式", ""),
    JLDW("计量单位", "JLDW", "计量单位", ""),
    SF("用户创建是否", "SF", "用户创建是否", ""),
    BQXH("标签型号1", "BQXH", "标签型号1", ""),
    BQZL("标签质量", "BQZL", "标签质量", "");

    private final String tPlusEnumName;
    private final String enumCode;
    private final String enumName;
    private final String categoryCode;

    /**
     * 获取枚举
     * <p>
     * Lambda表达式，比较判断
     *
     * @param tPlusEnumName 名称
     * @return
     */
    public static TPlusToEz2bizEnum getCurrency(String tPlusEnumName) {
        TPlusToEz2bizEnum[] alarmGrades = TPlusToEz2bizEnum.values();
        return Arrays.stream(alarmGrades)
                .filter(alarmGrade -> Objects.equals(alarmGrade.getTPlusEnumName(), tPlusEnumName))
                .findFirst().orElse(null);
    }

}
